/*
 * @Description: 初始化路由参数
 * @Author: CrowBlock81192
 * @Date: 2024-03-22 22:35:56
 */

import { createRouter, createWebHashHistory } from 'vue-router';
import type { App } from 'vue';
import routes from './routes/index';

const router = createRouter({
	history: createWebHashHistory(),
	routes,
	scrollBehavior: () => ({ left: 0, top: 0 }),
});

/**
 * 路由初始化函数
 * @param app
 */
export const setupRouter = (app: App<Element>) => {
	app.use(router);
};

export default router;
